package dp.observer;

import java.util.Observer;

public class Client {
    public static void main(String[] args) {
        
        //创建被观察者对象
        Subject subject = new Subject();
        //创建观察者对象，并将被观察者对象登记
        Observer watcher = new Watcher(subject);
        //给被观察者状态赋值
        subject.setData("start");
        subject.setData("run");
        subject.setData("stop");
    }
}
